package com.cheung.leetcode.normal;

import java.util.Arrays;
import java.util.List;

public class LC2824 {

    public static int countPairs(List<Integer> nums, int target) {
        int count = 0;
        for (int i = 0; i < nums.size(); i++) {
            for (int j = i + 1; j < nums.size(); j++) {
                if (nums.get(i) + nums.get(j) < target) {
                    count++;
                }
            }
        }

        return count;
    }

    public static void main(String[] args) {
        List<Integer> nums = Arrays.asList(-6, 2, 5, -2, -7, -1, 3);
        int target = -2;

        System.out.println(countPairs(nums, target));

    }
}
